package test.course.components {
	import flash.display.Sprite;
	import flash.text.TextField;
	
	public class TextButton extends Sprite {

		private var _labelField:TextField;

		public function TextButton(label:String) {
			_labelField=new TextField;
			_labelField.text=label;
			_labelField.width=_labelField.textWidth+5;
			_labelField.height=_labelField.textHeight+5;
			_labelField.x=5;
			_labelField.y=0;
			_labelField.textColor=0xffffff;
			addChild(_labelField);

			graphics.lineStyle(1,0x000000);
			graphics.beginFill(0x0000c0);
			graphics.drawRect(0,0,_labelField.width+10,15);
			graphics.endFill();

			buttonMode=true;
			mouseChildren=false;
		}
	}
}